package com.mrx.compose.demo.model.request

import com.alibaba.fastjson2.JSON
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody

/**
 * @author Mr.X
 * @since 2024-05-29 10:36
 **/
interface BaseRequest {

    fun toJSON(): Any

    fun toRequestBody() = JSON.toJSONString(toJSON()).toRequestBody("application/json; charset=utf-8".toMediaType())

}